local skynet = require "skynet"
local MessageType = require "common.message_type"

local watchdog_proxy = {}

local watchdog = nil

function watchdog_proxy.set_watchdog(w)
    watchdog = w
end

function watchdog_proxy.disconnect(fd,wait)
    fd = tonumber(fd) or 0
    wait = wait or false
    if wait then
        skynet.call(watchdog,"lua",MessageType.DisconnectClient,fd)
    else
        skynet.send(watchdog,"lua",MessageType.DisconnectClient,fd)
    end
end


return watchdog_proxy